<?php
    $auth = Zend_Auth::getInstance(); 
    if($auth->getIdentity())
    {
	$identity = $auth->getIdentity();
    }else{
	//$this->_helper->redirector('index', 'index');
    } 
?>
<h1>
	<?php 
		if($auth->getIdentity()&&$identity->getUserRank()!=0)
		{
			
			echo "Welcome ".$this->username."!";
		}
		else
		{
			echo "Welcome!";
		}
	
	?>
</h1>
<h1>APPLES Service-Learning Program Portal</h1>
<p>
Please use this portal to access our many great programs. User friendly access makes it easy for faculty, community partners and students to get connected to Service-Learning courses and Service-Learning Internships.
</p>

<?php if($this->announcement != ""):?>
<h2>Announcements</h2>
<p>
	<?php echo processAnnouncement($this->announcement); ?>
</p>
<?php endif ?>
<h2>APPLES Mission</h2>
<p>
APPLES is a student-led program that builds sustainable, service-learning partnerships among students, faculty and communities in North Carolina and beyond. By engaging all partners in an enriched, community-based curriculum, APPLES experiential programs foster socially aware and civically involved students.
</p>

<?php if($auth->hasIdentity()&&$identity->getUserRank() == 0):?>
	<h3><a href="
			   <?php echo $this->url(array('controller'=>'profile', 'action' => 'submit', 'type' => $identity->getUserType()),'default',true);?>
			"> Add Your Profile to Get Started </a></h3>
<?php endif; ?>

<?php
function processAnnouncement($text)
{

	$text = str_replace("\r\n","<br/>",$text);

	return $text;

}
?>